package jdesktop.appbar.win32;

import com.sun.jna.Pointer;
import com.sun.jna.Structure;

import java.awt.*;

public class RECT extends Structure
{
    public int left;
    public int top;
    public int right;
    public int bottom;

    public RECT()
    {
    }

    public RECT(int left, int right, int top, int bottom)
    {
        this.left = left;
        this.right = right;
        this.top = top;
        this.bottom = bottom;
    }

    public RECT(Pointer p)
    {
        super(p);
    }

    public void copyTo(Rectangle r)
    {
        r.x = left;
        r.y = top;
        r.width = right-left;
        r.height = bottom-top;
    }

    public void setBounds(Rectangle r)
    {
        left = r.x;
        top = r.y;
        right = r.x+r.width;
        bottom = r.y+r.height;
    }


    
}
